/*
 * 
 * LegendShop 多用户商城系统
 * 
 *  版权所有,并保留所有权利。
 * 
 */
package com.legendshop.oa.dao.impl;

import com.legendshop.dao.impl.GenericDaoImpl;
import com.legendshop.oa.dao.SystemConfigDao;
import com.legendshop.oa.model.SystemConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;
/**
 * 系统配置
 */
@Repository
public class SystemConfigDaoImpl extends GenericDaoImpl<SystemConfig, Long> implements SystemConfigDao {
     
	@Cacheable(value="SystemConfig")
	public SystemConfig getSystemConfig(){
		SystemConfig systemConfig = getById(1l);
		return systemConfig;
	}
	
	@CacheEvict(value="SystemConfig",allEntries=true)
	public Long saveSystemConfig(SystemConfig systemConfig){
		return (Long)save(systemConfig);
	}
	
	@CacheEvict(value="SystemConfig",allEntries=true)
	public void updateSystemConfig(SystemConfig systemConfig){//TODO 要先load出来再修改
		 update(systemConfig);
	}

	@Override
	public SystemConfig getSysWechatCode() {
		SystemConfig systemConfig = getById(1l);
		return systemConfig;
	}
	
	
 }
